﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PC.AzureMultiApp.Core.Models;
using PC.AzureMultiApp.Storage;
using PC.AzureMultiApp.Core.Helpers;

namespace PC.AzureMultiApp.Core.Events
{
    public static class AzureEvent
    {
        public static IEnumerable<AzureEventModel> GetEvents()
        {
            EventDataSource dataSource = new EventDataSource();

            var counters = dataSource.GetEvents()
                            .OrderByDescending(c => c.EventDateTime)
                            .Select(c => Conversions.GetAzureEvent(c));

             return counters;
        }

        public static void Clear()
        {
            EventDataSource dataSource = new EventDataSource();
            dataSource.Clear();
        }
    }
}
